import { defineConfig } from "vite";
import viteDevConfig from "./build/vite.config.dev.ts";
import viteProdConfig from "./build/vite.config.prod.ts";
import viteBaseConfig from "./build/vite.config.base.ts";

export default defineConfig(({ command }) => {
  if (command === "serve") {
    // dev环境配置
    return Object.assign(viteBaseConfig, viteDevConfig);
  } else {
    // prod环境配置
    return Object.assign(viteBaseConfig, viteProdConfig);
  }
});
